package com.kgc.service.impl;

import com.kgc.dao.UserDetailMapper;
import com.kgc.dao.UserMapper;
import com.kgc.dao.UserMapper_wzl;
import com.kgc.pojo.User;
import com.kgc.pojo.UserDetail;
import com.kgc.service.GetUserInfo_wzlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 获得用户信息
 * @author  王臻利
 */
@Service
public class GetUserInfo_wzlServiceImpl implements GetUserInfo_wzlService {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private UserDetailMapper userDetailMapper;

    @Autowired
    private UserMapper_wzl userMapper_wzl;
    /*获取用户信息*/
    public List<User> getUserdetailInfo_wzl() {
        return userMapper_wzl.getUserdetailInfo_wzl();
    }

    /*删除该用户列表*/
    public int delUserById_wzl(int id) {
        return userMapper.deleteByPrimaryKey(id);
    }
    /*删除用户详情列表*/
    public int delDetailById_wzl(int id){
        return userDetailMapper.deleteByPrimaryKey(id);
    }

    /*增加用户*/
    public int addUser_wzl(User user) {
        return userMapper.insertSelective(user);
    }
    /*增加用户详情信息*/
    public int addUser_wzl(UserDetail userDetail) {
        return userDetailMapper.insertSelective(userDetail);
    }
    /*查询user最后一条数据*/
    public User  selectUserLastInfo_wzl(){
        return userMapper_wzl.selectUserLastInfo();
    }
}
